
package com.globallogic.javatraining.liudmyla_shapoval.uni.people;

public abstract class Person {

	private static int person_id;
	private String firstname;
	private String secondname;
	private String email;

	public Person(String firstname, String secondname) {
		this.firstname = firstname;
		this.secondname = secondname;
	}


	public String getSecondname() {
		return secondname;
	}


	public String getFullName() {
		return firstname + secondname;
	}


	private int getNextId() {
		return person_id++;
	}

	@Override
	public boolean equals(Object object)	{
		if (object == this)	{
			return true;
		}
		
		if (object == null)	{
			return false;
		}
		
		if (!(getClass() == object.getClass()))	{
			return false;
		}
		else	{
				Person human = (Person)object;
				if(human.person_id == this.person_id)
					return true;
				else
					return false;
	    		}
	  }
	
}
